
import RkGrid from './table/RkGrid.vue'
import SvgIcon from '@/components/SvgIcon/index.vue'
// ----- 按钮组
import RkButtonGroup from './button/RkButtonGroup.vue'

// ----- 公用弹框
import RkDialog from './dialog/RkDialog.vue'
// ----- 单位区划树
import RkAdAgTree from './tree/RkAdAgTree.vue'

// ----- 布局相关组件
import RkContainer from './container/RkContainer.vue'
import RkCondition from './container/RkCondition.vue'
import RkConditionBar from './container/RkConditionBar.vue'
import RkContainerTopBottom from './container/RkContainerTopBottom.vue'


const components = {
  "rk-grid|RkGrid": RkGrid,
  "svg-icon|SvgIcon": SvgIcon,
  "rk-button-group|RkButtonGroup": RkButtonGroup,
  "rk-ad-ag-tree|RkAdAgTree": RkAdAgTree,
  "rk-dialog|RkDialog": RkDialog,
  "rk-container|RkContainer": RkContainer,
  "rk-condition|RkCondition": RkCondition,
  "rk-condition-bar|RkConditionBar": RkConditionBar,
  "rk-container-top-bottom|RkContainerTopBottom": RkContainerTopBottom,
}
export const setupComponents = function (app) {
  Reflect.ownKeys(components).forEach(keys => {
    if (keys.includes('|')) {
      keys.split('|').forEach(key => {
        app.component(key, components[keys])
      })
    } else {
      app.component(keys, components[keys])
    }
  })
}
